package org.grottarossa.template.data.pojo.list;


import java.util.ArrayList;

import org.grottarossa.template.data.enums.EnumDataType;
import org.grottarossa.template.data.pojo.utils.Container;

/**
 *
 * La Classe rappresenta l'oggetto lista.
 *
 * @author Marco Sabatini (sabatini.m@gmail.com)
 * @author Maurizio Farina (maurizio.farina@gmail.com)
 * @author Marco Trischitta (marco.trischitta@gmail.com)
 * @version %I%, %G%
 * @since 1.0
 *
 * */
public class List extends Container
{
	private String name;
	private EnumDataType dataType;
	ArrayList<Object> items = null;

	public List(String name, EnumDataType type)
	{
		this.setName(name);
		this.setType(dataType);
		items = new ArrayList<Object>();
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setType(EnumDataType type) {
		this.dataType = type;
	}

	public EnumDataType getType() {
		return this.dataType;
	}


	public boolean isEmpty()
	{
		return ( items.size() == 0 ? true : false);
	}

	public ArrayList<Object> getItems() {
		return items;
	}

	public void add (Object item) {
		this.items.add(item);
	}
}